package com.qf.controller;

import com.alibaba.fastjson.JSON;
import com.qf.common.R;
import com.qf.service.StudentService;
import com.qf.service.impl.StudentServiceImpl;
import com.qf.servlet.BaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebServlet("/student")
public class StudentController extends BaseServlet {

    private StudentService studentService = new StudentServiceImpl();

    public void doRegister(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            studentService.register(request, response);
    }

    public void doInitModify(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        studentService.initModify(request, response);
    }

    public void doModify(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        studentService.modify(request, response);

    }

    public void doGetStudents(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        studentService.getStudents(request, response);
    }

    public void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        studentService.delete(request, response);
    }
}